1 Carga de datos

dataAnnotatr <- read.csv(file.path(dataPath, dirO.7, "annotatr_results_E1_0.7.csv"))

2 Análisis

2.1 Términos GO

allGenesDF <- data.frame(ENTREZID = dataAnnotatr$annot.gene_id,
                       SYMBOL = dataAnnotatr$annot.symbol)

# allGenesDF <- bitr(allGenes, fromType = "SYMBOL",
#                       toType = c("ENSEMBL", "ENTREZID"),
#                       OrgDb = org.Hs.eg.db)
ggo1 <- sapply(c("MF", "CC", "BP"), function(term) {
              enrichGO(unique(allGenesDF$ENTREZID), org.Hs.eg.db,
                             ont = term, qvalueCutoff = 0.05,
                             readable = TRUE)})
dotplot(ggo1$MF, showCategory = 20, font.size = 8)

barplot(ggo1$MF, showCategory = 15, font.size = 9) + ggtitle("GO Molecular Function") + 
  theme(plot.title = element_text(face = "bold"))

ChIPseeker::upsetplot(ggo1$MF)

  # upsetplot(ggo1$MF)

# goplot(ggo1)
barplot(ggo1$CC, showCategory = 10, font.size = 9) + ggtitle("GO Cellular Component") + 
  theme(plot.title = element_text(face = "bold"))

barplot(ggo1$BP, showCategory = 20, font.size = 9) + ggtitle("GO Biological Process") + 
  theme(plot.title = element_text(face = "bold"))

ggo1MFsimplified <- simplify(ggo1$MF)

dotplot(ggo1MFsimplified, showCategory = 20, font.size = 8)

barplot(ggo1MFsimplified, showCategory = 20, font.size = 8) + ggtitle("GO Molecular Function") + 
  theme(plot.title = element_text(face = "bold"))

2.2 Rutas KEGG

kegg1 <- enrichKEGG(gene = allGenesDF$ENTREZID,
                    organism = "hsa")
dotplot(kegg1, showCategory = 20, font.size = 9) + ggtitle("KEGG pathways") + 
  theme(plot.title = element_text(face = "bold"))

barplot(kegg1, showCategory = 20, font.size = 9) + ggtitle("KEGG pathways") + 
  theme(plot.title = element_text(face = "bold"))

ChIPseeker::upsetplot(kegg1) + ggtitle("KEGG pathways") + 
  theme(plot.title = element_text(face = "bold"))

2.3 Marcadores celulares: bbdd Cell Marker

2.3.1 Cell Markers analysis

Link datos: http://bio-bigdata.hrbmu.edu.cn/CellMarker

dataHumanCells <- read.delim(file.path(analysisPath, "/data/Human_cell_markers.txt"))

dataHumanCells <- dataHumanCells %>% tidyr::unite("cellMarker", tissueType, 
                                                  cancerType, cellName, sep=", ") %>% 
   dplyr::select(cellMarker, geneID) %>%
   dplyr::mutate(geneID = strsplit(geneID, ', '))
typeCells <- enricher(unique(allGenesDF$ENTREZID), TERM2GENE = dataHumanCells,
                      pAdjustMethod = "fdr", minGSSize = 5, qvalueCutoff = 0.2)

dotplot(typeCells, showCategory = 10, font.size = 8)

barplot(typeCells, "GeneRatio", showCategory = 10, font.size = 9) + ggtitle("Enriquecimiento CellMarker") + 
  theme(plot.title = element_text(face = "bold"))

ChIPseeker::upsetplot(typeCells)

  motifs <- msigdbr(species = "Homo sapiens", category = "C3") 

2.3.2 MSigDB (subset C7: células inmunes)

geneImmSginature <- msigdbr(species = "Homo sapiens", category = "C7") %>% 
  dplyr::select(gs_name, entrez_gene)

immCells <- enricher(unique(allGenesDF$ENTREZID), TERM2GENE = geneImmSginature)
dotplot(immCells, showCategory = 10, font.size = 6)

barplot(immCells, "GeneRatio", showCategory = 10, font.size = 8) + ggtitle("Enriquecimiento MSigDB (C7)") + 
  theme(plot.title = element_text(face = "bold"))

ChIPseeker::upsetplot(immCells)

2.4 DisGeNET: enriquecimiento con enfermedades

dso1 <- enrichDGN(allGenesDF$ENTREZID, readable = TRUE)
dotplot(dso1, showCategory = 20, font.size = 8)

barplot(dso1, showCategory = 20, font.size = 9) + ggtitle("Enriquecimiento MSigDB (C7)") + 
  theme(plot.title = element_text(face = "bold"))

ChIPseeker::upsetplot(dso1)